package day06;

import java.util.Arrays;

public class Day6 {
    public static void main(String[] args) {
              int[] a = {10,30,10,20,50};
              int[] b = new int[6];
        System.arraycopy(a,0,b,3,2);
        int[] c = Arrays.copyOf(a, 5);
        int[] d = Arrays.copyOf(a, 5);
        for (int i = 0; i < b.length; i++) {
            System.out.println(b[i]);
        }

        int max = a[0];
        for (int i = 1; i <a.length ; i++) {
            if (a[i]>max){
                max = a[i];
            }
        }
        System.out.println("最大值为："+max);

        a=Arrays.copyOf(a,a.length+1);
        a[a.length-1]=max;
        for (int i = 0; i < a.length; i++) {
            System.out.println(a[i]);
        }

        double e = Math.random();

    }
}

